package com.hdoit.jiayuntong.Extends;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.ImageView;

@SuppressLint("NewApi")
public class ImageViewExtend extends ImageView {

	public ImageViewExtend(Context context){
		super(context);
	}
	
	public ImageViewExtend(Context context,AttributeSet attrs) {
		super(context,attrs);
	}
	
	public ImageViewExtend(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr, 0);
    }
	
	public ImageViewExtend(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
		super(context, attrs, defStyleAttr, defStyleRes);
	}
	
	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		Rect rec = canvas.getClipBounds();
		Paint paint = new Paint();
		paint.setColor(Color.parseColor("white"));
		paint.setStyle(Paint.Style.STROKE);
		paint.setStrokeWidth(5);  
		canvas.drawRect(rec, paint);
	}
}
